package com.sd.repay.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author sd
 * @Description: 线程池
 * @date 2017年10月25日
 */
public class ThreadFactory {
    private final static Object syncLock = new Object();
    private static int maxThreadInPool = 80;
    private static ExecutorService executor = null;

    public static ExecutorService getThread() {
        if (executor == null) {
            synchronized (syncLock) {
                if (executor == null) {
                    executor = Executors.newFixedThreadPool(maxThreadInPool);
                }
            }
        }
        return executor;
    }

}
